<%--
  Created by IntelliJ IDEA.
  User: YANG
  Date: 2019/10/30
  Time: 23:22
  To change this template use File | Settings | File Templates.
  基本信息，求职意向，工作经验，项目经验，教育经历，在校情况，技能特长，附加信息
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="s" uri="/struts-tags"%>
<html>
<head>
    <title>userresume</title>
    <link href="Css/userresume.css" rel="stylesheet">
    <script src="Js/jquery-3.4.1.min.js"></script>
</head>
<body>
<script>
//这里需要用Ajax请求
$(document).ready(function () {

    $.ajax({
        type:"GET",//请求方式get
        url:"UserResume.action",//请求的链接,直接写action即可
        datatype:"json",//返回回来的是json
        data:{
            UserID:<%=session.getAttribute("UserID")%>
        },
        success:function (res) {
            //填充所有信息，有点麻烦，执行的任务有点多的
            $("#basename").attr("value",res.baseInfomation.Name)
            $("#basephone").attr("value",res.baseInfomation.TelPhone)
            $("#basebirth").attr("value",res.baseInfomation.Birth)
            $("#baseemail").attr("value",res.baseInfomation.Email)
            $("#baseaddress").attr("value",res.baseInfomation.Address);
            $("#basesex ").get(0).selectedIndex=res.baseInfomation.Sex-1;

//求职意向
            $("#jobaddress").attr("value",res.jobIntension.WorkAddress)
            $("#jobkind").get(0).selectedIndex=res.jobIntension.WorkKind-1;
            $("#workname").attr("value",res.jobIntension.WorkName)
            $("#jobsalary ").get(0).selectedIndex=res.jobIntension.Salay-1;


//工作经验
            $("#companyname").attr("value",res.workExperience.CompanyName)
            $("#companykind").get(0).selectedIndex=res.workExperience.CompanyKind-1;
            $("#workdes").val(res.workExperience.WorkDes);
            $("#companyscale ").get(0).selectedIndex=res.workExperience.CompanyScale-1;
            $("#companyworkkind").get(0).selectedIndex=res.workExperience.WorkKind-1;

            $("#projectname").attr("value",res.projectExperience.ProjectName)
            $("#projectdes").val(res.projectExperience.ProjectDes)
            $("#belong").attr("value",res.projectExperience.Belong)
            $("#duty").val(res.projectExperience.Duty)

            $("#schoolname").attr("value",res.educationExperience.SchoolName)
            $("#finishtime").attr("value",res.educationExperience.FinishTime)
            $("#highestedu").attr("value",res.educationExperience.HighestEdu)
            $("#major").attr("value",res.educationExperience.Major)

            $("#honourone").attr("value",res.schoolSituation.HonourOne)
            $("#honourtwo").attr("value",res.schoolSituation.HonourTwo)
            $("#honourthree").attr("value",res.schoolSituation.HonourThree)
            $("#gradeone").get(0).selectedIndex=res.schoolSituation.GradeOne-1;
            $("#gradetwo").get(0).selectedIndex=res.schoolSituation.GradeTwo-1;
            $("#gradethree").get(0).selectedIndex=res.schoolSituation.GradeThree-1;

            $("#previous").attr("value",res.schoolSituation.Previous)
            $("#politic ").get(0).selectedIndex=res.schoolSituation.Politic-1;

            $("#training").attr("value",res.skills.Training)
            $("#skillbooks").attr("value",res.skills.SkillBooks)
            $("#englisgrade").get(0).selectedIndex=res.skills.EnglishGrade-1;
            $("#otherskills").attr("value",res.skills.OtherSkills)



            $("#self").val(res.appendInformation.SelfAssessment)
            //$("#basephone").innerText=res.baseInfomation.TelPhone;
            //$("#basebirth").innerText=res.baseInfomation.Birth;
           // $("#baseaddress").innerText=res.baseInfomation.Address;
           // $("#baseemail").innerText=res.baseInfomation.Email;
        },
        error:function (jqXHR) {

        }
    })
})

</script>
<%--点击我的简历后来到这个界面第一个div是旁边菜单--%>
<div class="menu" >
<%-- 包裹着策划菜单具体内容的div--%>
    <div class="menu-bar">
<%--        通过a标签定锚--%>
<%--        先用div将img和a标签包裹起来--%>
        <div class="menu-item">
<%-- 注意每个div之间的间距--%>
         <img src="Image/user.png">
         <a href="#baseinfo" class="base" >基本信息</a>
        </div>
    <div class="menu-item">
        <img src="Image/user.png">
        <a href="#applyfor" class="apply" >求职意向</a>
    </div>
    <div class="menu-item">
        <img src="Image/user.png" >
        <a href="#workexp" class="work" >工作经验</a>
    </div>
    <div class="menu-item">
        <img src="Image/user.png">
        <a href="#projectexp" class="project" >项目经验</a>
    </div>
    <div class="menu-item">
        <img src="Image/user.png" >
        <a href="#teachexp" class="teach">教育经历</a>
    </div>
    <div class="menu-item">
        <img src="Image/user.png" >
        <a href="#schoolexp" class="school">在校情况</a>
    </div>
    <div class="menu-item">
        <img src="Image/user.png" >
        <a href="#advantange" class="adv">技能特长</a>
    </div>
    <div class="menu-item">
        <img src="Image/user.png" >
        <a href="#extra" class="ext">附加信息</a>
    </div>

    <div class="menu-item">
        <img src="Image/user.png" >
        <a href="#extra" class="ext">导入简历</a>
    </div>
    </div >

</div>
    <%--点击我的简历后来到这个界面第二个div是旁边菜单选项所对应的简历信息--%>
<script>
    $(function () {
        $(".base").hover(function () {
        // 当点击对应的a标签时，对应的信息框背景颜色改为蓝色
           $(".baseinfo").css("background","#6699CC");
        },function () {
            $(".baseinfo").css("background","#eeeeee")
        })
        $(".apply").hover(function () {
            // 当点击对应的a标签时，对应的信息框背景颜色改为蓝色
            $(".applyfor").css("background","#6699CC")
        },function () {
            $(".applyfor").css("background","#eeeeee")
        })

        $(".work").hover(function () {
            // 当点击对应的a标签时，对应的信息框背景颜色改为蓝色
            $(".workexp").css("background","#6699CC");
        },function () {
            $(".workexp").css("background","#eeeeee")
        })

        $(".project").hover(function () {
            // 当点击对应的a标签时，对应的信息框背景颜色改为蓝色
            $(".projectexp").css("background","#6699CC");
        },function () {
            $(".projectexp").css("background","#eeeeee")
        })

        $(".teach").hover(function () {
            // 当点击对应的a标签时，对应的信息框背景颜色改为蓝色
            $(".teachexp").css("background","#6699CC");
        },function () {
            $(".teachexp").css("background","#eeeeee")
        })
        $(".school").hover(function () {
            // 当点击对应的a标签时，对应的信息框背景颜色改为蓝色
            $(".schoolexp").css("background","#6699CC");
        },function () {
            $(".schoolexp").css("background","#eeeeee")
        })
        $(".adv").hover(function () {
            // 当点击对应的a标签时，对应的信息框背景颜色改为蓝色
            $(".advantange").css("background","#6699CC");
        },function () {
            $(".advantange").css("background","#eeeeee")
        })
        $(".ext").hover(function () {
            // 当点击对应的a标签时，对应的信息框背景颜色改为蓝色
            $(".extra").css("background","#6699CC");
        },function () {
            $(".extra").css("background","#eeeeee")
        })

    })
</script>
<div class="userinfo">
<%--        使居中--%>
    <%--基本信息--%>
    <div id="baseinfo" class="baseinfo in">
    <%--这里是一个表单--%>
        <h2 align="center">基本信息</h2>
        <form action="BaseInfo" method="post">
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<label>姓名</label>&nbsp;&nbsp;<input id="basename" class="textfield" name="baseinfomation.Name" type="text"/>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<label>性别</label>&nbsp;&nbsp;<select id="basesex" name="baseinfomation.Sex" class="textfield"><option value="1">男</option><option value="2">女</option></select>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<label>手机</label>&nbsp;&nbsp;<input id="basephone" class="textfield" name="baseinfomation.TelPhone" type="text">
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<label>邮箱</label>&nbsp;&nbsp;<input id="baseemail" class="textfield" name="baseinfomation.Email" type="text">
        <label>出生日期</label>&nbsp;&nbsp;<input id="basebirth" class="textfield" name="baseinfomation.Birth" type="text">
        <label>现居住地</label>&nbsp;&nbsp;<input id="baseaddress" class="textfield" name="baseinfomation.Address" type="text">
            <div style="margin-left: 220px;">
            <input type="submit" value="保存">
            <input type="reset"  value="重置">
            </div>
        </form>
    </div>
    <%--求职意向--%>
    <div id="applyfor" class="applyfor in">
        <h2 align="center">求职意向</h2>
        <form action="JobIntent" method="post">
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<label>年薪</label>&nbsp;&nbsp;<select id="jobsalary" class="textfield" name="jobintension.Salary" ><option value="1">5-10万</option><option value="2">10-20万</option><option value="3">20-30万</option><option value="4">40-50万</option><option value="4">50万以上</option></select>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<label>地点</label>&nbsp;&nbsp;<input id="jobaddress" class="textfield" name="jobintension.WorkAddress" type="text">
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<label>职能</label>&nbsp;&nbsp;<input id="workname" class="textfield" name="jobintension.WorkName" type="text">
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<label>类型</label>&nbsp;&nbsp;<select id="jobkind" class="textfield" name="jobintension.WorkKind" ><option value="1">全职</option><option value="2">兼职</option><option value="3">实习</option><option value="4">全/兼职</option></select>
            <div style="margin-left: 220px;">
                <input type="submit" value="保存">
                <input type="reset"  value="重置">
            </div>
        </form>
    </div>
    <%--工作经验--%>
    <div id="workexp" class="workexp in">
        <h2 align="center">工作经验</h2>
        <form action="WorkExp" method="post">
            <label>企业名称</label>&nbsp;&nbsp;<input id="companyname" class="textfield" name="workexperience.CompanyName" type="text">
            <label>企业类型</label>&nbsp;&nbsp;<select id="companykind" name="workexperience.CompanyKind" class="textfield"><option value="1">上市公司</option><option value="2">国企</option><option value="3">私营</option></select>
            <label>企业规模</label>&nbsp;&nbsp;<select id="companyscale" name="workexperience.CompanyScale" class="textfield"><option value="1">100以下</option><option value="2">100-500人</option><option value="3">500人-2000人</option><option value="4">2000人以上</option></select>
            <label>工作类型</label>&nbsp;&nbsp;<select id="companyworkkind" name="workexperience.WorkKind" class="textfield"><option value="1">全职</option><option value="2">兼职</option><option value="3">实习</option><option value="4">全/兼职</option></select>
            <label>工作描述</label>&nbsp;&nbsp;<textarea id="workdes" name="workexperience.WorkDes" style="width: 470px;height: 100px" class="textfield"/>

            <div style="margin-left: 220px;">
                <input type="submit" value="保存">
                <input type="reset"  value="重置">
            </div>
        </form>
    </div>
    <div id="projectexp" class="projectexp in">
        <h2 align="center">项目经验</h2>
        <form action="ProjectExp" method="post">
            <label>所属企业</label>&nbsp;&nbsp;<input id="belong" name="projectexperience.Belong" class="textfield"  type="text">
            <label>项目名称</label>&nbsp;&nbsp;<input id="projectname" name="projectexperience.ProjectName" class="textfield"  type="text">
            <label>项目描述</label>&nbsp;&nbsp;<textarea id="projectdes" name="projectexperience.ProjectDes" class="textfield" style="width: 470px;height: 100px"  /><br>
            <label>责任描述</label>&nbsp;&nbsp;<textarea id="duty" name="projectexperience.Duty" class="textfield"  style="width: 470px;height: 100px"  />
            <div style="margin-left: 220px;">
                <input type="submit" value="保存">
                <input type="reset"  value="重置">
            </div>
        </form>
    </div>
    <%--教育经历--%>
    <div id="teachexp" class="teachexp in">
        <h2 align="center">教育经历</h2>
        <form action="EducationExp" method="post">
             <label>最高学历</label>&nbsp;&nbsp;<select id="highestedu" name="educationexperience.HighestEdu" class="textfield"><option value="1">博士</option><option value="2">硕士</option><option value="2">本科</option></select>
             <label>毕业学校</label>&nbsp;&nbsp;<input id="schoolname" name="educationexperience.SchoolName"  class="textfield" type="text">
             <label>毕业时间</label>&nbsp;&nbsp;<input id="finishtime" name="educationexperience.FinishTime" class="textfield"  type="text">
             <label>专业方向</label>&nbsp;&nbsp;<input id="major" name="educationexperience.Major" class="textfield"  type="text">
            <div style="margin-left: 220px;">
                <input type="submit" value="保存">
                <input type="reset"  value="重置">
            </div>
        </form>
    </div>
    <%--在校经历--%>
    <div id="schoolexp" class="schoolexp in">
        <h2 align="center">在校经历</h2>
        <form action="SchoolExp" method="post">
            &nbsp;&nbsp;&nbsp;<label>奖项一</label>&nbsp;&nbsp;<input id="honourone" name="schoolexperience.HonourOne" class="textfield"  type="text">
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<label>等级</label>&nbsp;&nbsp;<select id="gradeone" name="schoolexperience.GradeOne" class="textfield"><option value="1">国家级</option><option value="2">省级</option><option value="3">市级</option></select>
            &nbsp;&nbsp;&nbsp;<label>奖项二</label>&nbsp;&nbsp;<input id="honourtwo" name="schoolexperience.HonourTwo" class="textfield"  type="text">
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<label>等级</label>&nbsp;&nbsp;<select id="gradetwo" name="schoolexperience.GradeTwo" class="textfield"><option value="1">国家级</option><option value="2">省级</option><option value="3">市级</option></select>
            &nbsp;&nbsp;&nbsp;<label>奖项三</label>&nbsp;&nbsp;<input id="honourthree" name="schoolexperience.HonourThree" class="textfield"  type="text">
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<label>等级</label>&nbsp;&nbsp;<select id="gradethree" name="schoolexperience.GradeThree" class="textfield"><option value="1">国家级</option><option value="2">省级</option><option value="3">市级</option></select>
            <label>曾任职务</label>&nbsp;&nbsp;<input id="previous" name="schoolexperience.Previous" class="textfield"  type="text">
            <label>政治面貌</label>&nbsp;&nbsp;<select id="politic" name="schoolexperience.Politic" class="textfield"><option value="1">党员</option><option value="2">团员</option><option value="3">群众</option></select>
            <div style="margin-left: 220px;">
                <input type="submit" value="保存">
                <input type="reset"  value="重置">
            </div>
        </form>
    </div>
    <%--特长优点--%>
    <div id="advantange" class="advantange in">
        <h2 align="center">技能特长</h2>
        <form action="Skills" method="post">
            <label>英语等级</label>&nbsp;&nbsp;<select id="englisgrade" name="skills.EnglishGrade" class="textfield"><option value="1">专八</option><option value="2">六级</option><option value="3">四级</option><option value="4">无</option></select>
            <label>技能证书</label>&nbsp;&nbsp;<input id="skillbooks" name="skills.SkillBooks" class="textfield" type="text">
            <label>培训经历</label>&nbsp;&nbsp;<input id="training" name="skills.Training" class="textfield"  type="text">
            <label>其他特长</label>&nbsp;&nbsp;<input id="otherskills" name="skills.OtherSkills"  class="textfield" type="text">
            <div style="margin-left: 220px;">
                <input type="submit" value="保存">
                <input type="reset"  value="重置">
            </div>
        </form>
    </div>
    <%--附加信息--%>
    <div id="extra" class="extra in">
        <h2 align="center">附加信息</h2>
        <form action="AppendInfo" method="post">
            <label>生活照片</label>&nbsp;&nbsp;<s:file name="appendinformation.Photo" type="text"></s:file>
            <label>个人自评</label>&nbsp;&nbsp;<textarea id="self" name="appendinformation.SelfAssessment" class="textfield"  style="width: 470px;height: 100px"  />
            <div style="margin-left: 220px;">
                <input type="submit" value="保存">
                <input type="reset"  value="重置">
            </div>
        </form>
    </div>


<%--    导入简历--%>
    <div id="extraresume" class="extra in">
        <h2 align="center">导入简历</h2>
        <form action="ExtraResume" method="post" enctype="multipart/form-data">
            <label>自定义简历</label>&nbsp;&nbsp;<s:file name="upload" type="text"></s:file>
            <div style="margin-left: 220px;">
                <input type="submit" value="保存">
                <input type="reset"  value="重置">
            </div>
        </form>
    </div>
    </div>
</body>
</html>
